<template>
  <div class="co_party_detail co_party">
    <Row style="width: 600px;">
      <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="100">
        <FormItem label="合作方名称">
          <Input type="text" v-model="formValidate.partnerName" disabled style="width: 280px;"></Input>
        </FormItem>
        <FormItem>
          <Button type="primary" class="pa-submit-btn" @click="back">返回</Button>
        </FormItem>
      </Form>
    </Row>
    <!-- <div class="search-box">
      <Row type="flex">
        <Col class="search-item">
        <span class="search-label">合作方名称:</span>
        <Input v-model="searchObj.Name"
               disabled
               :maxlength="30"
               placeholder="请输入">
        </Input>
        </Col>
      </Row>
      <Row>
        </Col>
        <Col class="search-item">
        <Button class="search-btn"
                type="primary"
                @click="doSearch">返回</Button>
        </Col>
    </Row>-->
    <!-- </div> -->
  </div>
</template>
<script>
import { getPartnerDetail } from '@/api/system/fishing.js'
import { routeEqual } from '@/libs/util'
import './main.less'
export default {
  name: 'cooperation_party_detail',
  data () {
    return {
      formValidate: {
        partnerName: ''
      },
      ruleValidate: {

      }
    }
  },
  mounted () {
    this.getDetail()
  },
  methods: {
    back () {
      this.closeModal()
    },
    closeModal () {
      this.$store.commit('closeTag', this.$route)
      this.$store.commit('setTagNavList', this.$store.state.app.tagNavList.filter(item => !routeEqual(this.$route, item)))
      this.$nextTick(() => {
        this.$router.push({
          name: 'cooperation_party_list'
        })
      })
    },
    getDetail () {
      getPartnerDetail({
        merchantId: this.$store.state.user.merchantId,
        partnerId: this.$route.query.id
      }).then(res => {
        if (res.data.status === 200) {
          this.formValidate.partnerName = res.data.data.partnerName
        } else {
          this.$Message.error(`${res.data.error}`)
        }
      })
    }
  }
}
</script>
